<?php  	
	require_once("includes/header.php");
	require_once("include_dao.php");		
		
	
	$arr = DAOFactory::getGenderDAO()->queryall();	
	$dtomovie 	= new Movie();
	if (isset($_GET['PkMovie']))
			if($_GET['PkMovie'] != '')
		{		
			$dtomovie = DAOFactory::getMovieDAO()->load($_GET['PkMovie']);
		}
?>
<style type="text/css">
#mlist #main div .main .form-1 .field input {
	color: #000;
}
#mlist #main div .main .form-1 .field input {
	color: #000;
}
</style>


<div id="mlist">
    <div id="main"><!-- Slidebox -->              
        <div align="center">
            <?php	
				if(isset($_GET["err"])){
					if ($_GET["err"] != ''){
						echo("<marquee>");
						// Mensajes de error 		
							$msn =  msn_error($_GET["err"]);
							echo($msn);
						// Fin de Mensajes de Error			
						echo("</marquee>");
					}
				}
			?> 
            <section class="main">            
              <form class="form-1" method="post" action="class/core/clsMovie.php">
                
                	<input type="hidden" name="PkMovie" value="<?php echo $dtomovie->pKMovie; ?>">
                	   	             
                    
                    <p class="field">
                        <input type="text" name="name" placeholder="Nombre" maxlength="50" value="<?php echo $dtomovie->name; ?>">
                        <i class="icon-film icon-large"></i>
                    </p>
                    
                    <p class="field">
                    
                        <select name='fKGender'> 
                        <?php 
								
							for($i=0;$i<count($arr);$i++)
							{							
								$row = $arr[$i];
								if( $dtomovie->fKGender ==$row->pKGender){
									echo "<option value='$row->pKGender' selected='true' >$row->name</option>";
								}
								else{								
									echo "<option value='$row->pKGender' >$row->name</option>";
								}
							}
						?>
                        </select>
                        <i class="icon-edit icon-large"></i>
                    </p>
                    
                    <p class="field">
          				<input type="text" name="stakeholders" placeholder="Elenco" value="<?php echo $dtomovie->stakeholders; ?>">
                        <i class="icon-group icon-large"></i>
                    </p>
                    
                    <p class="field">
                        <input type="text" name="director" placeholder="Director " maxlength="50" value="<?php echo $dtomovie->director ; ?>">
						<i class="icon-user icon-large"></i>
                    </p>
                    
                    <p class="field">
                        <input type="text" name="format" placeholder="Formato" maxlength="50" value="<?php echo $dtomovie->format; ?>">
                        <i class="icon-edit icon-large"></i>
                    </p>
                    
                    <p class="field">
                        <input type="text" name="year" placeholder="Año" maxlength="50" value="<?php echo $dtomovie->year; ?>"><i class="icon-calendar icon-large"></i>
                      
                         
                        </input>
                        
                        
                        
                <p class="field">
                        
                              <input type="text" name="rate" placeholder="Velocidad" maxlength="50" value="<?php echo $dtomovie->rate; ?>">
                        <i class="icon-fast-forward	 icon-large"></i>
                </p>
                    
                    <p class="field">
          				<input type="text" name="price" placeholder="Precio" value="<?php echo $dtomovie->price; ?>">
                        <i class="icon-money icon-large"></i>
                    </p>
                    
                    <p class="field">
                        <input type="text" name="priceRentals" placeholder="Precio de alquiler " maxlength="50" value="<?php echo $dtomovie->priceRentals ; ?>">
						<i class="icon-money icon-large"></i>
                    </p>
                    
                    <p class="field">
                        <input type="text" name="languages" placeholder="Lenguajes" maxlength="50" value="<?php echo $dtomovie->languages; ?>">
                        <i class="icon-font icon-large"></i>
                    </p>
                    
                    <p class="field">
                        <input type="text" name="subtitles" placeholder="Subtitulos" maxlength="50" value="<?php echo $dtomovie->subtitles; ?>">
                            
                        </input>
                        <i class="icon-italic icon-large"></i>
                    </p>    
                    
                <p class="field">
                        <input type="text" name="description" placeholder="Descripcion" maxlength="500" value="<?php echo $dtomovie->description; ?>">
                            
                        </input>
                        <i class="icon-edit icon-large"></i>
                    </p>                  
                    
                    <p class="field">
                        <input type="text" name="runtime" placeholder="Tiempo" maxlength="500" value="<?php echo $dtomovie->runtime; ?>">
                            
                        </input>
                    <i class="icon-time icon-large"></i></p>
                <p align="left" class="field">
                      
  <input name="picturePath" type="file" method="get"  enctype="multipart/form-data" value= ./img/."<?php echo  $dtomovie->picturePath; ?>" />
                 
            </p>       

                    <p class="submit">
                        <button type="submit" name="submit">
                        	<i class="icon-pencil icon-large"></i>
                        </button>
                    </p>
              </form>                
            </section> 
            </br></br>          
        </div>    
           
        <div class="clear"></div>
        
    </div>
</div>     

<?php	require_once("includes/footer.php");	?>